﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Authorityuserlist.aspx.cs" Inherits="OpSystem.Manage.InfoManage.Authorityuserlist" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!-- #include file="~/include/header.html" -->
</head>
<body>
    <form id="form1" runat="server">
        <section class="content-header">
            <h1>用户管理
                <small></small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>主页</a></li>
                <li class="active">用户管理</li>
            </ol>
        </section>
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <div class="box box-primary">
                        <div class="box-header">
                            <button type="button" class="btn btn-success btn-sm" id="addbtn">添加用户</button>
                            <h3 class="box-title"></h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover body-table-head">
                                <colgroup>
                                    <col style="width: 50px" />
                                    <col style="width: 95px" />
                                    <col style="width: 95px" />
                                    <col style="width: 80px" />
                                    <col style="width: 70px" />
                                    <col style="width: 130px" />
                                    <col style="width: 105px" />
                                    <col style="width: 140px" />
                                </colgroup>
                                 <tbody >
                                    <tr>
                                        <th>
                                            ID
                                        </th>
                                        <th>
                                            账号
                                        </th>
                                        <th>
                                            <span>名称</span>
                                        </th>

                                        <th>
                                            <span>联系电话</span>
                                        </th>

                                        <th>
                                            <span>登录次数</span>
                                        </th>
                                        <th>
                                            <span>角色</span>
                                        </th>

                                        <th>
                                            <span>最后登录时间</span>
                                        </th>
                                        <th class="t_c">
                                            <span>操作</span>
                                        </th>
                                    </tr>
                         
                                    <asp:Repeater runat="server" ID="rptList">
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                   <%# Eval("UserID") %>
                                                </td>
                                                <td>
                                                   <%# Eval("LoginName") %>
                                                </td>

                                                <td><%# Eval("UserName")%>
                                       
                                                </td>
                                                <td>
                                                    <%# Eval("ContactMobile")%>
                                                </td>
                                                <td>
                                                    <%# Eval("LoginCount")%>
                                                </td>
                                                <td>
                                                    <%# GetRoleNameByUserId((int)Eval("UserID"))%>
                                                </td>

                                                <td>
                                                    <%# ((DateTime)Eval("LastLoginDate")).ToString("yyyy-MM-dd HH:mm:ss")%>
                                                </td>
                                                <td class="t_c">
                                                    <button type="button" class="btn btn-info btn-xs" onclick="edit('<%# Eval("UserID")%>')">编辑</button>
                                                    <button type="button" class="btn btn-primary btn-xs" onclick="editpwd('<%# Eval("UserID")%>')">修改密码</button>
                                                    <button type="button" class="btn btn-warning btn-xs" onclick="role('<%# Eval("UserID")%>')">角色</button>
                                                    <button type="button" class="btn btn-danger btn-xs" onclick="del('<%# Eval("UserID")%>')">删除</button>
                                                </td>
                                            </tr>
                                        </ItemTemplate>

                                        <FooterTemplate>
                                            <tr style='display: <%#bool.Parse((rptList.Items.Count==0).ToString())==true?"":"none"%>'>
                                                    <td colspan="8" style="text-align: center">
                                                         <div class="no-data">
                                                            <div class="img-box"></div>
                                                            <div class="text">暂无数据</div>
                                                        </div>
                                                    </td>
                                                </tr>
                                        </FooterTemplate>
                                    </asp:Repeater>
                                </tbody>
                            </table>

                            
                            <!-- /.box-body -->
                        </div>
                        <div class="box-footer clearfix ">
                                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" showinputbox="Never" CssClass="pagination pagination-sm no-margin pull-right"
                                    PageSize="10" OnPageChanged="AspNetPager1_PageChanged" LayoutType="Ul"
                                    PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active">
                                </webdiyer:AspNetPager>

                            </div>
                        <!-- /.box -->
                    </div>

                </div>
            </div>
        </section>
    </form>
     <!-- #include file="~/include/footer.html" -->
    <script type="text/javascript">
        $("#addbtn").click(function () {
            var url = '<%=GetPageUrl("AuthorityUserAdd.aspx")%>';
            BMCW.showTopLayer('添加用户', url, 560, 423);
        });

        function edit(uid)
        {
            var url = '<%=GetPageUrl("AuthorityUserAdd.aspx")%>?id='+uid;
            BMCW.showTopLayer('修改用户', url, 560, 373);
        }

        function editpwd(uid)
        {
            var url = '<%=GetPageUrl("AuthorityPwdEdit.aspx")%>?id='+uid;
            BMCW.showTopLayer('修改密码', url, 560, 303);
        }

        function del(uid) {
            BMCW.DataConfirmMaskDel('deluser', uid);
        }

        function role(uid)
        {
            var url = '<%=GetPageUrl("AuthorityUserRole.aspx")%>?id='+uid;
            BMCW.showTopLayer('配置角色', url, 560, 403);
        }
    </script>
</body>
</html>
